Skip to content

Trivial fixes to JSTypedArray #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2023
Merged

Trivial fixes to JSTypedArray #223

merged 2 commits into from
Mar 13, 2023

Conversation

kateinoigakukun
Copy link
Member

No description provided.

let rawBuffer = malloc(bytesLength)!
defer { free(rawBuffer) }
_load_typed_array(jsObject.id, rawBuffer.assumingMemoryBound(to: UInt8.self))
let length = lengthInBytes / MemoryLayout<Element>.size
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yonihemi Do you remember whether it's intentional or not to read lengthInBytes twice?

@github-actions
Copy link

Time Change: -2ms (0%)

Total Time: 16,540ms

Test name Duration Change
Serialization/JavaScript function call through Wasm import with int 35ms +8ms (23%) 🚨
View Unchanged
Test name Duration Change
Serialization/JavaScript function call through Wasm import 54ms +1ms
Serialization/JavaScript function call from Swift 233ms +8ms (3%)
Serialization/Swift Int to JavaScript with assignment 507ms +2ms (0%)
Serialization/Swift Int to JavaScript with call 1,510ms -8ms (0%)
Serialization/JavaScript Number to Swift Int 526ms +5ms (0%)
Serialization/Swift String to JavaScript with assignment 584ms -4ms (0%)
Serialization/Swift String to JavaScript with call 1,601ms +22ms (1%)
Serialization/JavaScript String to Swift String 6,972ms -27ms (0%)
Object heap/Increment and decrement RC 4,493ms -8ms (0%)
View Baselines
Test name Duration
Serialization/Call JavaScript function directly 3ms
Serialization/Assign JavaScript number directly 4ms
Serialization/Call with JavaScript number directly 4ms
Serialization/Write JavaScript string directly 10ms
Serialization/Call with JavaScript string directly 4ms

Copy link
Member

@j-f1 j-f1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@kateinoigakukun kateinoigakukun merged commit 6cf6d35 into main Mar 13, 2023
@kateinoigakukun kateinoigakukun deleted the katei/trivial-fixes branch March 13, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants